load("//bazel:skia_rules.bzl", "exports_files_legacy", "skia_filegroup", "split_srcs_and_hdrs")

licenses(["notice"])

exports_files_legacy()

# A list of files that is included by C++ files, but whose
# implementation resides in .mm files. The latter may need to
# be compiled separately (e.g. with Automatic Reference Counting [ARC]).
skia_filegroup(
    name = "mtl_cpp_hdrs",
    srcs = [
        "GrMtlCppUtil.h",
        "GrMtlTrampoline.h",
    ],
)

MTL_FILES = [
    "GrMtlAttachment.h",
    "GrMtlAttachment.mm",
    "GrMtlBuffer.h",
    "GrMtlBuffer.mm",
    "GrMtlCaps.h",
    "GrMtlCaps.mm",
    "GrMtlCommandBuffer.h",
    "GrMtlCommandBuffer.mm",
    "GrMtlDepthStencil.h",
    "GrMtlDepthStencil.mm",
    "GrMtlFramebuffer.h",
    "GrMtlFramebuffer.mm",
    "GrMtlGpu.h",
    "GrMtlGpu.mm",
    "GrMtlOpsRenderPass.h",
    "GrMtlOpsRenderPass.mm",
    "GrMtlPipeline.h",
    "GrMtlPipelineState.h",
    "GrMtlPipelineState.mm",
    "GrMtlPipelineStateBuilder.h",
    "GrMtlPipelineStateBuilder.mm",
    "GrMtlPipelineStateDataManager.h",
    "GrMtlPipelineStateDataManager.mm",
    "GrMtlRenderCommandEncoder.h",
    "GrMtlRenderTarget.h",
    "GrMtlRenderTarget.mm",
    "GrMtlResourceProvider.h",
    "GrMtlResourceProvider.mm",
    "GrMtlSampler.h",
    "GrMtlSampler.mm",
    "GrMtlSemaphore.h",
    "GrMtlSemaphore.mm",
    "GrMtlTexture.h",
    "GrMtlTexture.mm",
    "GrMtlTextureRenderTarget.h",
    "GrMtlTextureRenderTarget.mm",
    "GrMtlTrampoline.mm",
    "GrMtlTypesPriv.h",
    "GrMtlTypesPriv.mm",
    "GrMtlUniformHandler.h",
    "GrMtlUniformHandler.mm",
    "GrMtlUtil.h",
    "GrMtlUtil.mm",
    "GrMtlVaryingHandler.h",
    "GrMtlVaryingHandler.mm",
]

split_srcs_and_hdrs(
    name = "mtl",
    files = MTL_FILES,
)

skia_filegroup(
    name = "objc_srcs",
    srcs = [
        ":mtl_srcs",
    ],
    visibility = ["//src/gpu/ganesh:__pkg__"],
)

skia_filegroup(
    name = "private_hdrs",
    srcs = [
        ":mtl_cpp_hdrs",
        ":mtl_hdrs",
    ],
    visibility = ["//src/gpu/ganesh:__pkg__"],
)
